package com.hl.sfzy.exception;

import com.hl.sfzy.utils.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalExceptionHandler {
    /**
     * 处理系统运行异常
     *
     */
    @ExceptionHandler(value = ProjectException.class)
    @ResponseBody
    public Result bizExceptionHandler(ProjectException e) {
        return Result.defineError(e);
    }
}